<div class="hbox hbox-auto-xs hbox-auto-sm" ng-init="
    app.settings.asideFolded = false; 
    app.settings.asideDock = false;
  ">
    <!-- main -->
    <div class="col">
        <!-- main header -->
        <div class="bg-light lter b-b wrapper-md">
            <div class="row">
                <div class="col-sm-6 col-xs-12">
                    <h1 class="m-n font-thin h3 text-black">堡垒机管理</h1>
                    <!--<small class="text-muted">可访问堡垒机列表管理</small>-->
                </div>
            </div>
        </div>
        <!-- / main header -->
        <div class="wrapper-md">
            <!-- toaster directive -->
            <toaster-container
                    toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
            <!-- / toaster directive -->

            <uib-tabset>
                <uib-tab index="0" heading="用户">
                    <div ng-controller="keyboxManageUserCtrl">
                        <div style="margin-top: 5px;" class="panel panel-default">
                            <div class="panel-body">
                                <form class="form-inline" role="form">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <span class="input-group-addon">授权用户</span>
                                            <input type="text" class="form-control" ng-model="username"
                                                   placeholder="授权用户">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <button type="button" class="btn btn-info" ng-click="doQuery()"><span
                                                class="glyphicon glyphicon-search"></span>搜索
                                        </button>
                                    </div>
                                    <div class="form-group">
                                        <button type="button" class="btn btn-success" ng-click="addUser()">
                                            <span class="glyphicon glyphicon-plus"></span>新建用户
                                        </button>
                                    </div>
                                    <div class="form-group">
                                        <button type="button" class="btn btn-info" ng-click="createGlobalFile()">
                                            <span class="glyphicon glyphicon-floppy-save"></span>生成全局文件
                                        </button>
                                    </div>
                                    <div class="form-group">
                                        <button type="button" class="btn btn-info"
                                                ng-click="createAllUserGroupConfigFile()"><span
                                                class="glyphicon glyphicon-floppy-save"></span>生成所有用户配置
                                        </button>
                                    </div>
                                </form>
                                <div style="margin-top: 5px;">
                                    <table class="table table-hover table-bordered table-striped">
                                        <thead>
                                        <tr>
                                            <td>授权用户</td>
                                            <td>姓名</td>
                                            <td>Email</td>
                                            <td>授权</td>
                                            <td>授权服务器组</td>
                                            <td>更新时间</td>
                                            <td>操作</td>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr ng-repeat="item in pageData">
                                            <td>{{item.username}}</td>
                                            <td>{{item.displayName}}</td>
                                            <td>{{item.mail}}</td>
                                            <!--<td>{{item.authed == 0 ? "未授权" : "已授权"}}</td>-->
                                            <td>
                                                <b ng-if="item.authed != 0" style="color: #449d44">已授权</b>
                                                <span ng-if="item.authed == 0">未授权</span>
                                            </td>
                                            <td>
                                                <span class="badge pull-right" ng-if="item.servers == 0">{{item.servers}}</span>
                                                <span class="badge pull-right bg-success"
                                                      ng-if="item.servers > 0 && item.servers < 10">{{item.servers}}</span>
                                                <span class="badge pull-right bg-info" ng-if="item.servers >= 10">{{item.servers}}</span>
                                            </td>
                                            <td>{{(item.gmtModify == null || item.gmtModify == '') ? item.gmtCreate :
                                                item.gmtModify}}
                                            </td>
                                            <td>
                                                <!--authorize-->
                                                <button ng-click="addAuth(item.username)"
                                                        ng-show="item.servers != 0"
                                                        class="btn btn-xs"
                                                        uib-popover-html="'授权&更新授权'" popover-trigger="'mouseenter'"
                                                        style="margin-left: 5px; background-color: red; color: white;">
                                                    <span class="glyphicon glyphicon-log-in"></span>授权
                                                </button>

                                                <!--<span  class="glyphicon glyphicon-log-in"-->
                                                <!--uib-popover-html="'授权&更新授权'" popover-trigger="'mouseenter'"-->
                                                <!--ng-click="addAuth(item.username)" ng-show="item.servers != 0">-->
                                                <!--</span>-->

                                                <button ng-click="serverList(item.username)"
                                                        class="btn btn-xs"
                                                        uib-popover-html="'授权服务器组列表'" popover-trigger="'mouseenter'"
                                                        style="margin-left: 5px; background-color: limegreen; color: white;">
                                                    <span class="glyphicon glyphicon-th-list"></span>服务器组
                                                </button>

                                                <!--<span class="glyphicon glyphicon-th-list" style="margin-left: 20px;"-->
                                                <!--uib-popover-html="'授权服务器组列表'" popover-trigger="'mouseenter'"-->
                                                <!--ng-click="serverList(item.username)"></span>-->

                                                <button ng-click="delAuth(item.username)"
                                                        ng-show="item.authed != 0"
                                                        class="btn btn-xs pull-right"
                                                        style="background-color: red; color: white;">
                                                    <span class="glyphicon glyphicon-log-out"></span>解除
                                                </button>

                                                <!--<span class="glyphicon glyphicon-log-out pull-right" style="color: #d9534f"-->
                                                <!--uib-popover-html="'解除授权'" popover-trigger="'mouseenter'"-->
                                                <!--ng-click="delAuth(item.username)" ng-show="item.authed != 0">-->
                                                <!--</span>-->

                                            </td>
                                        </tr>
                                        </tbody>
                                        <tfoot>
                                        <tr>
                                            <td colspan="10">
                                                <ul style="margin: 0px; float: right;" uib-pagination
                                                    total-items="totalItems" ng-model="currentPage"
                                                    items-per-page="pageLength" max-size="10" ng-change="pageChanged()"
                                                    previous-text="&lsaquo;" next-text="&rsaquo;"></ul>
                                            </td>
                                        </tr>
                                        </tfoot>
                                    </table>

                                    <div style="font-size:0.5em;">&nbsp;</div>
                                    <div class="panel panel-info">
                                        <div class="panel-heading">执行结果</div>
                                        <div ng-if="taskVO.taskServerList != null">
                                      <span class="label" style="background-color: #3c3c3c">
                                              <i class="fa fa-spin fa-spinner"
                                                 ng-show="taskVO.ansibleTaskDO.finalized ==false"></i>
                                              <b ng-show="taskVO.ansibleTaskDO.finalized ==false">指令执行中...</b>
                                              <i ng-show="taskVO.ansibleTaskDO.finalized ==true">指令执行完成</i>
                                              <i uib-popover-html="'执行的指令'"
                                                 popover-trigger="'mouseenter'">  任务/指令:{{taskVO.ansibleTaskDO.cmd}}</i>
                                              <i uib-popover-html="'服务器数量'"
                                                 popover-trigger="'mouseenter'" class="label">  ServerTotal:{{taskVO.ansibleTaskDO.serverCnt}}</i>

                                        <input type="checkbox" ng-model="resultChoose.all" ng-click="chooseAllResult()"><b
                                              style="color: #00a8f3"> 所有结果</b>
                                        <input type="checkbox" ng-model="resultChoose.success"
                                               ng-click="chooseResult(0)"><b
                                              style="color: #00af00"> SUCCESS</b>
                                        <input type="checkbox" ng-model="resultChoose.failed"
                                               ng-click="chooseResult(1)"><b
                                              style="color: #ef2929"> FAILED</b>
                                        </span>
                                        </div>

                                        <div class="form-group">
                                            <form class="form-inline" role="form" ng-if="taskVO.taskServerList != null">
                                                <table class="table" style="margin-top: 5px;">
                                                    <tbody>
                                                    <tr ng-repeat="taskServer in taskVO.taskServerList">
                                                        <td class="col-md-12" ng-show="checkResultShow(taskServer)">
                                                            <div class="panel-heading"
                                                                 style="background-color: #2e6da4">
                                                    <span class="label label-default"
                                                          ng-if="taskServer.serverDO.envType == 0">{{taskServer.serverDO.serverName + "-" + taskServer.serverDO.serialNumber}}(保留)</span>
                                                                <span class="label label-info"
                                                                      ng-if="taskServer.serverDO.envType == 1">{{taskServer.serverDO.serverName + "-" + taskServer.serverDO.serialNumber}}(dev)</span>
                                                                <span class="label label-success"
                                                                      ng-if="taskServer.serverDO.envType == 2">{{taskServer.serverDO.serverName + "-" + taskServer.serverDO.serialNumber}}(daily)</span>
                                                                <span class="label label-warning"
                                                                      ng-if="taskServer.serverDO.envType == 3">{{taskServer.serverDO.serverName + "-" + taskServer.serverDO.serialNumber}}(gray)</span>
                                                                <span class="label label-danger"
                                                                      ng-if="taskServer.serverDO.envType == 4">{{taskServer.serverDO.serverName + "-" + taskServer.serverDO.serialNumber}}(prod)</span>
                                                                <span class="label label-primary"
                                                                      ng-if="taskServer.serverDO.envType == 5">{{taskServer.serverDO.serverName + "-" + taskServer.serverDO.serialNumber}}(test)</span>
                                                                <span class="label label-primary"
                                                                      ng-if="taskServer.serverDO.envType == 6">{{taskServer.serverDO.serverName + "-" + taskServer.serverDO.serialNumber}}(back)</span>

                                                                <span class="label label-info">{{taskServer.ip}}</span>
                                                                <span class="label label-success"
                                                                      ng-if="taskServer.result == 'SUCCESS'">{{taskServer.result}}</span>
                                                                <span class="label label-danger"
                                                                      ng-if="taskServer.result != 'SUCCESS'">{{taskServer.result}}</span>
                                                                <span class="label label-info"
                                                                      ng-show="taskServer.returncode != null">{{taskServer.returncode}}</span>

                                                                <button ng-click="closeTaskServer(taskServer.serverId)"
                                                                        class="btn btn-xs pull-right"
                                                                        style="margin-left: 20px; background-color: #ff8700; color: white;">
                                                                    <span class="glyphicon glyphicon-remove"></span>关闭
                                                                </button>
                                                            </div>
                                                            <div hljs hljs-source="taskServer.msg"></div>
                                                        </td>
                                                    </tr>
                                                    </tbody>
                                                </table>

                                            </form>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <div ng-if="alert.type != ''">
                                            <div uib-alert ng-class="'alert-' + alert.type" close="closeAlert()">
                                                {{alert.msg}}
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </uib-tab>
                <uib-tab index="1" heading="服务器组">
                    <div ng-controller="keyboxManageServerGroupCtrl">
                        <div class="panel panel-default">
                            <div class="panel-body">
                                <form class="form-inline" role="form">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <span class="input-group-addon">名称</span>
                                            <input type="text" class="form-control" ng-model="queryName"
                                                   placeholder="名称">
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <button type="button" class="btn btn-info" ng-click="doQuery()"><span
                                                class="glyphicon glyphicon-search"></span>搜索
                                        </button>
                                        <button type="button" class="btn btn-success" ng-click="checkUser()"><span
                                                class="glyphicon glyphicon-check"></span>CheckUsers
                                        </button>
                                    </div>
                                </form>
                                <div style="margin-top: 5px;">
                                    <table class="table table-hover table-bordered table-striped">
                                        <thead>
                                        <tr>
                                            <td class="col-md-1">服务器组名</td>
                                            <td class="col-md-1">使用类型</td>
                                            <td class="col-md-1">服务器</td>
                                            <td class="col-md-1">授权数量</td>
                                            <td class="col-md-5">授权用户</td>
                                            <td class="col-md-2">说明</td>
                                            <td class="col-md-1">操作</td>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr ng-repeat="item in pageData">
                                            <td>{{item.name}}</td>
                                            <td>
                                                <b style="color: #777" ng-if="item.useType == 10">bi</b>
                                                <b style="color: #843534" ng-if="item.useType == 1">zookeeper</b>
                                                <b style="color: #286090" ng-if="item.useType == 2">web-service</b>
                                                <b style="color: #ec971f" ng-if="item.useType == 3">mysql</b>
                                                <b style="color: #286090" ng-if="item.useType == 4">other</b>
                                                <b style="color: #777" ng-if="item.useType == 5">web-php</b>
                                                <b style="color: #286090" ng-if="item.useType == 6">public</b>
                                                <b style="color: #d9534f" ng-if="item.useType == 7">redis</b>
                                                <b style="color: #449d44" ng-if="item.useType == 8">web-server</b>
                                                <b style="color: #5bc0de" ng-if="item.useType == 9">front-end</b>
                                            </td>
                                            <td>
                                                <span class="badge pull-right" ng-if="item.serverCnt == 0">0</span>
                                                <span class="badge pull-right bg-success"
                                                      ng-if="item.serverCnt > 0 && item.serverCnt < 10">{{item.serverCnt}}</span>
                                                <span class="badge pull-right bg-info" ng-if="item.serverCnt >= 10">{{item.serverCnt}}</span>
                                            </td>
                                            <td>
                                                <span class="badge pull-right" ng-if="item.userCnt == 0">0</span>
                                                <span class="badge pull-right bg-success"
                                                      ng-if="item.userCnt > 0 && item.userCnt < 10">{{item.userCnt}}</span>
                                                <span class="badge pull-right bg-info" ng-if="item.userCnt >= 10">{{item.userCnt}}</span>
                                            </td>
                                            <td>
                                                <div class="col-md-6" ng-repeat="userName in item.users">{{userName}}
                                                </div>
                                            </td>
                                            <td>{{item.content}}</td>
                                            <td>
                                                <button ng-click="userList(item.id)"
                                                        class="btn btn-xs"
                                                        style="margin-left: 5px; background-color: #2e6da4; color: white;">
                                                    <span class="icon icon-users"></span>用户详情
                                                </button>

                                                <!--<span  class="icon icon-users"-->
                                                <!--ng-click="userList(item.id)">-->
                                                <!--</span>-->
                                                <button ng-click="delServerGroup(item)"
                                                        ng-if="contains(authPoint, '/servergroup/del')"
                                                        class="btn btn-xs pull-right"
                                                        style="background-color: red; color: white;">
                                                    <span class="glyphicon glyphicon-remove"></span>删除
                                                </button>

                                                <!--<button type="button" class="btn btn-danger btn-xs pull-right"-->
                                                <!--ng-click="delServerGroup(item)"-->
                                                <!--ng-if="contains(authPoint, '/servergroup/del')">删除-->
                                                <!--</button>-->
                                            </td>
                                        </tr>
                                        </tbody>
                                        <tfoot>
                                        <tr>
                                            <td colspan="7">
                                                <ul style="margin: 0px; float: right;" uib-pagination
                                                    total-items="totalItems" ng-model="currentPage"
                                                    items-per-page="pageLength" max-size="10" ng-change="pageChanged()"
                                                    previous-text="&lsaquo;" next-text="&rsaquo;"></ul>
                                            </td>
                                        </tr>
                                        </tfoot>
                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </uib-tab>
                <uib-tab index="2" heading="堡垒机密钥管理">
                    <div ng-controller="keyboxManageKeyCtrl">
                        <div class="panel">
                            <div class="panel-body">
                                <div class="form-horizontal">
                                    <!--<div class="form-group">-->
                                    <!--<div class="col-md-8">-->
                                    <!--<label class="col-md-3 control-label"><span style="color: #ec2121;">*</span>私钥(rsa)</label>-->
                                    <!--<div class="col-md-8">-->
                                    <!--<textarea class="form-control" ng-model="keyItem.originalPrivateKey"-->
                                    <!--rows="16"></textarea>-->
                                    <!--</div>-->
                                    <!--</div>-->
                                    <!--</div>-->

                                    <!--style="background-color: #54596a"-->
                                    <div class="form-group">
                                        <div class="col-md-8">
                                            <label class="col-md-3 control-label"><span style="color: #ec2121;">*</span>加密的私钥(rsa)</label>
                                            <div ng-show="!editPrivateKey" hljs
                                                 hljs-source="keyItem.privateKey"></div>
                                            <div class="col-md-9">
                                                <textarea
                                                        uib-popover-html="'填入pirvateKey（id_rsa）原文'"
                                                        popover-trigger="'mouseenter'"
                                                        ng-show="editPrivateKey" class="form-control"
                                                        ng-model="keyItem.originalPrivateKey"
                                                        rows="16"></textarea>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="form-group">
                                        <div class="col-md-8">
                                            <label class="col-md-3 control-label">私钥原文指纹</label>
                                            <div class="col-md-9">
                                                <input type="text" class="form-control" ng-model="keyItem.md5" readonly>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="form-group" style="text-align:center;">
                                        <button ng-click="editKey()" ng-show="!editPrivateKey"
                                                class="btn btn-xs"
                                                style="margin-left: 5px; background-color: #00af00; color: white;">
                                            <span class="glyphicon glyphicon-edit"></span>编辑私钥
                                        </button>

                                        <button ng-click="saveKey()" ng-show="editPrivateKey"
                                                class="btn btn-xs"
                                                style="margin-left: 5px; background-color: #ef2929; color: white;">
                                            <span class="glyphicon glyphicon-ok"></span>保存私钥
                                        </button>
                                    </div>

                                    <div class="form-group">
                                        <div class="col-md-8">
                                            <label class="col-md-3 control-label"><span style="color: #ec2121;">*</span>公钥(public
                                                key)</label>
                                            <div ng-show="!editPublicKey" hljs
                                                 hljs-source="keyItem.publicKey"></div>
                                            <div class="col-md-9">
                                                <textarea ng-show="editPublicKey" class="form-control"
                                                          ng-model="keyItem.publicKey"
                                                          rows="5"></textarea>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="form-group" style="text-align:center;">
                                        <button ng-click="editPubKey()" ng-show="!editPublicKey"
                                                class="btn btn-xs"
                                                style="margin-left: 5px; background-color: #00af00; color: white;">
                                            <span class="glyphicon glyphicon-edit"></span>编辑公钥
                                        </button>

                                        <button ng-click="saveKey()" ng-show="editPublicKey"
                                                class="btn btn-xs"
                                                style="margin-left: 5px; background-color: #ef2929; color: white;">
                                            <span class="glyphicon glyphicon-ok"></span>保存公钥
                                        </button>
                                    </div>


                                </div>
                            </div>
                        </div>
                    </div>
                </uib-tab>
                <uib-tab index="3" heading="Jumpserver管理">
                    <div ng-controller="jumpserverCtrl">
                        <div style="margin-top: 5px;" class="panel">
                            <div class="panel-body">

                                <div class="form-horizontal col-md-12">
                                    <div class="form-group">
                                        <button type="button" class="btn btn-info" ng-click="getJumpserver()"><span
                                                class="glyphicon glyphicon-repeat"></span>刷新
                                        </button>
                                    </div>
                                </div>

                                <!--活动会话-->
                                <div class="form-horizontal col-md-12">
                                    <!--终端-->
                                    <div class="col-md-12">
                                        <uib-accordion close-others="false">
                                            <div uib-accordion-group class="panel-default"
                                                 heading="Administrators"
                                                 is-open="true" style="box-shadow: 0 0 5px #ddd;padding: 10px;">
                                                <uib-accordion-heading>
                                                    <b style="color: #777">活动会话</b>
                                                    <span class="label pull-right"
                                                          style="background-color: #2a2a2b; color: white;">TerminalSession</span>
                                                </uib-accordion-heading>

                                                <div style="margin-top: 5px;">

                                                    <table class="table table-striped">
                                                        <thead>
                                                        <tr>
                                                            <td><b style="margin-left: 5px; color: #777">用户</b></td>
                                                            <td><b style="margin-left: 5px; color: #777">用户IP</b></td>
                                                            <td><b style="margin-left: 5px; color: #777">系统账户@主机</b></td>
                                                            <td><b style="margin-left: 5px; color: #777">终端</b></td>
                                                            <td><b style="margin-left: 5px; color: #777">协议</b></td>
                                                            <td class="col-md-2"><b style="margin-left: 5px; color: #777">开始时间</b></td>
                                                        </tr>
                                                        </thead>

                                                        <tbody>
                                                        <tr ng-repeat="session in jumpserver.terminalSessions"
                                                            style="font-size:1em;">
                                                            <td>{{session.user}}</td>
                                                            <td>{{session.remote_addr}}</td>
                                                            <td>{{session.system_user}}@{{session.asset}}</td>
                                                            <td>
                                                                <b style="margin-left: 5px; color: #286090">{{session.terminal_name}}</b>
                                                            </td>
                                                            <td>{{session.protocol}}</td>
                                                            <td>{{session.date_start}}</td>
                                                        </tr>
                                                        </tbody>
                                                    </table>
                                                </div>

                                            </div>
                                        </uib-accordion>
                                    </div>

                                </div>

                                <div class="form-horizontal col-md-6">
                                    <div class="col-md-12">
                                        <uib-accordion close-others="false">
                                            <div uib-accordion-group class="panel-default" heading="Jumpserver"
                                                 is-open="true" style="box-shadow: 0 0 5px #ddd;padding: 10px;">
                                                <uib-accordion-heading>
                                                    <b style="color: #777">Jumpserver</b>
                                                    <span class="label pull-right"
                                                          style="background-color: #00a8f3; color: white;">{{jumpserver.host}}</span>
                                                </uib-accordion-heading>
                                                <div class="col-md-12">
                                                    <label class="col-md-2 control-label"><span
                                                            style="color: #ec2121;">*</span><b
                                                            style="color : #777">管理账户</b></label>
                                                    <div class="col-md-8">
                                                        <ui-select ng-model="nowAdminuser.selected"
                                                                   theme="bootstrap">
                                                            <ui-select-match placeholder="搜索管理账户名称......">
                                                                {{$select.selected.username}}
                                                            </ui-select-match>
                                                            <ui-select-choices
                                                                    refresh="queryAdminuser($select.search)"
                                                                    refresh-dalay="0"
                                                                    repeat="item in adminuserList | filter: $select.search">
                                                                <div ng-bind-html="item.username | highlight: $select.search"></div>
                                                            </ui-select-choices>
                                                        </ui-select>
                                                    </div>
                                                    <div class="col-md-2" style="margin-top: 5px;">
                                                        <button type="button" class="btn btn-xs"
                                                                style="margin-left: 5px; background-color: limegreen; color: white;"
                                                                ng-click="saveAdminuser()"><span
                                                                class="glyphicon glyphicon-ok"></span>保存
                                                        </button>
                                                    </div>
                                                </div>

                                                <div class="col-md-12" style="margin-top: 5px;">
                                                    <label class="col-md-2 control-label"><span
                                                            style="color: #ec2121;">*</span><b
                                                            style="color : #777">系统账户</b></label>
                                                    <div class="col-md-8">
                                                        <ui-select ng-model="nowSystemuser.selected"
                                                                   theme="bootstrap">
                                                            <ui-select-match placeholder="搜索系统账户名称......">
                                                                {{$select.selected.username}}
                                                            </ui-select-match>
                                                            <ui-select-choices
                                                                    refresh="querySystemuser($select.search)"
                                                                    refresh-dalay="0"
                                                                    repeat="item in systemuserList | filter: $select.search">
                                                                <div ng-bind-html="item.username | highlight: $select.search"></div>
                                                            </ui-select-choices>
                                                        </ui-select>
                                                    </div>
                                                    <div class="col-md-2" style="margin-top: 5px;">
                                                        <button type="button" class="btn btn-xs"
                                                                style="margin-left: 5px; background-color: limegreen; color: white;"
                                                                ng-click="saveSystemuser()"><span
                                                                class="glyphicon glyphicon-ok"></span>保存
                                                        </button>
                                                    </div>
                                                </div>

                                            </div>
                                        </uib-accordion>
                                    </div>

                                    <div class="col-md-12">
                                        <uib-accordion close-others="false">
                                            <div uib-accordion-group class="panel-default"
                                                 heading="Administrators"
                                                 is-open="true" style="box-shadow: 0 0 5px #ddd;padding: 10px;">
                                                <uib-accordion-heading>
                                                    <b style="color: #777">超级管理员</b>
                                                    <span class="label pull-right"
                                                          style="background-color: #ff8700; color: white;">Administrators</span>
                                                </uib-accordion-heading>
                                                <div>
                                                    <label class="col-md-2 control-label"><span
                                                            style="color: #ec2121;">*</span><b
                                                            style="color : #777">用户名</b></label>
                                                    <div class="col-md-8">
                                                        <ui-select ng-model="nowUser.selected" theme="bootstrap">
                                                            <ui-select-match placeholder="搜索用户名称......">
                                                                {{$select.selected.username}}
                                                            </ui-select-match>
                                                            <ui-select-choices refresh="queryUser($select.search)"
                                                                               refresh-dalay="0"
                                                                               repeat="item in userList | filter: $select.search">
                                                                <div ng-bind-html="item.username | highlight: $select.search"></div>
                                                            </ui-select-choices>
                                                        </ui-select>
                                                    </div>
                                                    <div class="col-md-2" style="margin-top: 5px;">
                                                        <button type="button" class="btn btn-xs"
                                                                style="background-color: red; color: white;"
                                                                ng-click="authAdmin()">
                                                            <i class="glyphicon glyphicon-plus"></i>授权
                                                        </button>
                                                    </div>
                                                </div>

                                                <div style="margin-top: 5px;">

                                                    <table class="table table-striped">
                                                        <thead>
                                                        <tr>
                                                            <td class="col-md-6"><b style="margin-left: 10px; color: #777">管理员</b></td>
                                                            <td class="col-md-6"><b style="margin-left: 10px; color: #777">Email</b></td>
                                                        </tr>
                                                        </thead>

                                                        <tbody>
                                                        <tr ng-repeat="administrator in jumpserver.administrators"
                                                            style="font-size:1em;">
                                                            <td>
                                                                <b style="margin-left: 5px; color: #286090">{{administrator.username}}<{{administrator.name}}></b>
                                                            </td>
                                                            <td>{{administrator.email}}
                                                            </td>
                                                        </tr>
                                                        </tbody>
                                                    </table>
                                                </div>

                                            </div>
                                        </uib-accordion>
                                    </div>
                                </div>


                                <!--用户/主机-->
                                <div class="form-horizontal col-md-6">
                                    <div class="col-md-12">
                                        <uib-accordion close-others="false">
                                            <div uib-accordion-group class="panel-default" heading="Hosts"
                                                 is-open="true" style="box-shadow: 0 0 5px #ddd;padding: 10px;">
                                                <uib-accordion-heading>
                                                    <b style="color: #777">主机</b>
                                                    <span class="label pull-right"
                                                          style="background-color: #00a8f3; color: white;">Hosts</span>
                                                </uib-accordion-heading>
                                                <div>
                                                    <b>Local Hosts</b>
                                                    <button type="button" class="btn btn-xs"
                                                            style="margin-left: 5px; background-color: limegreen; color: white;"
                                                            ng-click="syncAssets()">
                                                        <i class="fa fa-spin fa-spinner"
                                                           ng-show="btnSyncAssets"></i>
                                                        <i class="icon icon-control-play"
                                                           ng-show="!btnSyncAssets"></i>全量同步主机
                                                    </button>
                                                    <span class="badge pull-right" style="color: #286090">{{jumpserver.localServersTotal}}</span>
                                                </div>

                                                <div style="margin-top: 10px;">
                                                    <b>Jumpserve Hosts</b>
                                                    <span class="badge pull-right" style="color: #286090">{{jumpserver.jumpserverAssetsTotal}}</span>
                                                </div>
                                            </div>
                                        </uib-accordion>
                                    </div>

                                    <div class="col-md-12">
                                        <uib-accordion close-others="false">
                                            <div uib-accordion-group class="panel-default" heading="Users"
                                                 is-open="true" style="box-shadow: 0 0 5px #ddd;padding: 10px;">
                                                <uib-accordion-heading>
                                                    <b style="color: #777">用户</b>
                                                    <span class="label pull-right"
                                                          style="background-color: #ff5f87; color: white;">Users</span>
                                                </uib-accordion-heading>
                                                <div>
                                                    <b>Local Users</b>
                                                    <button type="button" class="btn btn-xs"
                                                            style="margin-left: 5px; background-color: limegreen; color: white;"
                                                            ng-click="syncUsers()">
                                                        <i class="fa fa-spin fa-spinner"
                                                           ng-show="btnSyncUsers"></i>
                                                        <i class="icon icon-control-play"
                                                           ng-show="!btnSyncUsers"></i>全量同步用户
                                                    </button>
                                                    <span class="badge pull-right" style="color: #286090">{{jumpserver.localUsersTotal}}</span>
                                                </div>

                                                <div style="margin-top: 10px;">
                                                    <b>Jumpserver Users</b>
                                                    <span class="badge pull-right" style="color: #286090">{{jumpserver.jumpserverUsersTotal}}</span>
                                                </div>
                                            </div>
                                        </uib-accordion>
                                    </div>

                                    <!--终端-->
                                    <div class="col-md-12">
                                        <uib-accordion close-others="false">
                                            <div uib-accordion-group class="panel-default"
                                                 heading="Administrators"
                                                 is-open="true" style="box-shadow: 0 0 5px #ddd;padding: 10px;">
                                                <uib-accordion-heading>
                                                    <b style="color: #777">终端</b>
                                                    <span class="label pull-right"
                                                          style="background-color: #ff8700; color: white;">Terminal</span>
                                                </uib-accordion-heading>

                                                <div style="margin-top: 5px;">

                                                    <table class="table table-striped">
                                                        <thead>
                                                        <tr>
                                                            <td class="col-md-3"><b style="margin-left: 10px; color: #777">名称</b></td>
                                                            <td class="col-md-3"><b style="margin-left: 10px; color: #777">IP</b></td>
                                                            <td class="col-md-3"><b style="margin-left: 10px; color: #777">SSH/HTTP</b></td>
                                                            <td class="col-md-3"><b style="margin-left: 10px; color: #777">会话</b></td>
                                                        </tr>
                                                        </thead>

                                                        <tbody>
                                                        <tr ng-repeat="terminal in jumpserver.terminals"
                                                            style="font-size:1em;">
                                                            <td>
                                                                <b style="margin-left: 5px; color: #286090">{{terminal.name}}</b>
                                                            </td>
                                                            <td>{{terminal.remote_addr}}</td>
                                                            <td>{{terminal.ssh_port}}/{{terminal.http_port}}</td>
                                                            <td>{{terminal.session}}</td>
                                                        </tr>
                                                        </tbody>
                                                    </table>
                                                </div>

                                            </div>
                                        </uib-accordion>
                                    </div>

                                </div>


                            </div>
                        </div>
                    </div>

                </uib-tab>
            </uib-tabset>
        </div>
    </div>
    <!-- / main -->
</div>

<script type="text/ng-template" id="keyBoxServerModal">
    <div ng-include="'tpl/modal/keybox/keybox_server_modal.html'"></div>
</script>

<script type="text/ng-template" id="keyBoxUserModal">
    <div ng-include="'tpl/modal/keybox/keybox_user_modal.html'"></div>
</script>

<!--公共模版-->
<script type="text/ng-template" id="userInfo">
    <div ng-include="'tpl/modal/user_info_modal.html'"></div>
</script>